// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

const int N = 4e5+50;

const int INF = 0x3f3f3f3f, MOD = 998244353;

struct ios {
    inline char read(){
        static const int IN_LEN=1<<18|1;
        static char buf[IN_LEN],*s,*t;
        return (s==t)&&(t=(s=buf)+fread(buf,1,IN_LEN,stdin)),s==t?-1:*s++;
    }

    template <typename _Tp> inline ios & operator >> (_Tp&x){
        static char c11,boo;
        for(c11=read(),boo=0;!isdigit(c11);c11=read()){
            if(c11==-1)return *this;
            boo|=c11=='-';
        }
        for(x=0;isdigit(c11);c11=read())x=x*10+(c11^'0');
        boo&&(x=-x);
        return *this;
    }

    int read(char *s) {
        int len = 0;
        char ch;
        for (ch=read(); ch=='\n' || ch == ' '; ch=read());
        if (ch == -1) {
            s[len] = 0;
            return -1;
        }
        for (; ch!='\n' && ch != ' ' && ch != -1;ch=read())
            s[len++] = ch;
        s[len] = 0;
        return len;
    }
} io;

template<typename T>
struct Bit {
    inline int lowbit(int i) { return i & (-i); }

    T dat[N];

    void clear(int n) {
        memset(dat, 0, sizeof(T) * (n + 1));
    }

    inline void add(int i, T x) {
        ++i;
        for (; i<N; i+=lowbit(i))
            dat[i] = (dat[i] + x) % MOD;
    }

    inline T sum(int i) {
        ++i;
        T res = 0;
        for (; i; i-=lowbit(i))
            res = (res + dat[i]) % MOD;
        return res;
    }
};

Bit<int> bit;

template<typename T>
struct snode {
    int id;
    T v;
    snode (int id=0, T v=0):id(id), v(v) {}

    bool operator < (const snode &other) const {
        if (v != other.v) return v < other.v;
        else return id < other.id;
    }
};

// template<typename T>
// typedef snode T;
template<typename T>
struct segT {
    T dat[N << 2];
    LL lazy[N << 2];
    int nn;

    void init(int n) {
        nn = 1;
        while (nn < n) 
            nn <<= 1;

        for (int i=1; i<=n; ++i)
            dat[i+nn-1] = snode<int>(i, 0);
        for (int i=nn+n; i<2*nn; ++i)
            dat[i] = snode<int>(-1, -INF);
        for (int i=nn-1; i>=0; --i)
            pu(i);
    }

    inline void pd(int rt) {
        if (lazy[rt]) {
            int ls = rt << 1, rs = rt << 1 | 1;
            dat[ls].v = dat[rs].v = lazy[ls] = lazy[rs] = lazy[rt];
            lazy[rt] = 0;
        }
    }

    inline void pu(int rt) {
        dat[rt] = max(dat[rt<<1], dat[rt<<1|1]);
    }

    
    int L, R;

    void u(int l, int r, int rt, int v) {
        if (L <= l && r <= R) {
            dat[rt].v = lazy[rt] = v;
            return;
        }
        int m = (l+r) >> 1;
        pd(rt);
        if (L <= m) u(l, m, rt<<1, v);
        if (m+1<=R) u(m+1, r, rt<<1|1, v);
        pu(rt);
    }
    T q(int l, int r, int rt) {
        // dbg(l, r, rt, dat[rt].v);
        if (L <= l && r <= R) {
            return dat[rt];
        }
        int m = (l + r) >> 1; pd(rt);
        T v1 = snode<int>(-1, -INF), v2 = snode<int>(-1, -INF);
        if (L <= m) v1 = q(l, m, rt<<1);
        if (m+1<=R) v2 = q(m+1, r, rt<<1|1);
        pu(rt);
        return max(v1, v2);
    }
    void u(int l, int r, int x) {
        // dbg(l, r, x);
        L = l;
        R = r;
        u(1, nn, 1, x);
    }
    T q(int l, int r) {
        L = l;
        R = r;
        return q(1, nn, 1);
    }
};

segT<snode<int>> seg;

struct Robot {
    int x, d;
} a[N];

int n;
int rb[N];

int main(int argc, char const *argv[]) {
    // code
    io >> n;
    for (int i=1; i<=n; ++i) {
        io >> a[i].x >> a[i].d;
        a[i].d = a[i].x + a[i].d - 1;
    }
    int tot;
    {
        vector<int> disc(2*n);
        int dcnt = 0;
        for (int i=1; i<=n; ++i) {
            disc[dcnt++] = a[i].x;
            disc[dcnt++] = a[i].d;
        }

        sort(disc.begin(), disc.end());
        disc.resize(unique(disc.begin(), disc.end()) - disc.begin());
        
        for (int i=1; i<=n; ++i) {
            a[i].x = lower_bound(disc.begin(), disc.end(), a[i].x) - disc.begin() + 1;
            a[i].d = lower_bound(disc.begin(), disc.end(), a[i].d) - disc.begin() + 1;
        }

        // for (int i=1; i<=n; ++i)
        //     dbg(i, a[i].x, a[i].d);

        seg.init(disc.size());
        tot = disc.size();
    }

    {
        sort(a+1, a+n+1, [](const Robot &a, const Robot &b) {
            return a.x < b.x;
        });
    }

    {


        for (int i=n; i>=1; --i) {
            rb[i] = max(a[i].d, seg.q(a[i].x, a[i].d).v);
            seg.u(a[i].x, a[i].d, rb[i]);
        }

        // for (int i=1; i<=n; ++i)
        //     dbg(i, rb[i]);
    }

    bit.add(0, 1);
    for (int i=1; i<=n; ++i) {
        bit.add(rb[i], bit.sum(a[i].x-1));
    }

    int ans = bit.sum(tot);
    printf("%d\n", ans);




    return 0;
}
